﻿

Public Class Splitting
    'Ctor :
    Public Sub New()
        Me.Reset()
    End Sub
    'Fields :
    Private _Size As Long
    Public Property Size As Long
        Get
            Return _Size
        End Get
        Set(value As Long)
            _Size = value
            _SplitSize = _Size
        End Set
    End Property
    Private _SplitSize As Long
    Public Property SplitSize As Long
        Get
            Return _SplitSize
        End Get
        Set(value As Long)
            _SplitSize = value
            If _SplitSize > _Size Then
                _SplitSize = _Size
            ElseIf _SplitSize < 6565536 Then
                _SplitSize = _Size
            End If
        End Set
    End Property
    'Routines :
    Public Sub Reset()
        _SplitSize = _Size
    End Sub
    Public Sub CopyFrom(ByVal spl As Splitting)
        _Size = spl.Size
        _SplitSize = spl.SplitSize
    End Sub
    Public Sub ApplyToZip(ByVal zip As Zip.ZipFile)
        zip.MaxOutputSegmentSize = CInt(_SplitSize)
    End Sub
    Public Function Infos() As String
        Return String.Format("Splitting : Size = {0} Split Size = {1}", _
                             StringFromSize(Me.Size), StringFromSize(Me.SplitSize))
    End Function
End Class



